//分类接口统一管理
import * as apiUrl from './constant.js'
import { httpGet, httpPost } from './httpUtils.js'
export let fecthBanners = () => httpGet(apiUrl.banners)
export let askLists = (index) => httpGet(apiUrl.asks + `${index}/json`)

export let collected = (id) => httpPost(`${apiUrl.collectArcile}/${id}/json`)

export let uncollected = (id) => httpPost(`${apiUrl.uncollectUrl}/${id}/json`)

export let courses = () => httpGet(apiUrl.course)

export let courseDetails = (index, id) => httpGet(
    `${apiUrl.courseList}/${index}/json?cid=${id}&order_type=1`
);
export let wxcharts = () => httpGet(apiUrl.wxcharts)
export let histories = (id, index) => httpGet(`${apiUrl.wxhis}${id}/${index}/json`)

export let collectArciles = (id) => httpPost(`${apiUrl.collectArcile}/${id}/json`)


export let trees = () => httpGet(apiUrl.trees)

export let projects = (index, cid) => httpGet(`${apiUrl.projects}${index}/json?cid=${cid}`)

export let todos = (index) => {
    let temp = `${apiUrl.toDoList}${index}/json`
    console.log('url', temp);
    return httpGet(`${apiUrl.toDoList}${index}/json`)
}